Returning a GLib.Error from a method invocation will encode the
error when sent over the wire. In case the error itself is already
an encoded remote error, just passing it on will result in double
wrapping.
Avoid that by stripping any remote error information before
returning it.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3159>
return false;
if (error instanceof GLib.Error) {
+ Gio.DBusError.strip_remote_error(error);
invocation.return_gerror(error);
} else {
let name = error.name;